package com.stylefeng.guns.common.enu;

public enum BillTypeEnum {

    TICKET(1,"车票"),
    SALARY(2,"商品"),
    OTHER(3,"其他");

    private Integer code;
    private String name;

    BillTypeEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static String getName(Integer code) {
        if(code==null || code==0){
            return "其他";
        }
        for (BillTypeEnum emu : BillTypeEnum.values()) {
            if (emu.code.equals(code)) {
                return emu.name;
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }
}
